/**
 * 
 */
package com.shequan.activity.service.impl;

import java.util.List;

import com.shequan.activity.bean.pojo.ActivityNews;
import com.shequan.activity.dao.ActivityNewsDAO;
import com.shequan.activity.service.ActivityNewsService;
import com.shequan.common.bean.ResultDataStruct;

/**
 * <P>
 * Copyright 2012.
 * </p>
 * <P>
 * All Rights Reserved.
 * </p>
 * @author YuJF
 * @version 1.0, 2012-3-15
 * @see com.shequan.activity.service.impl.ActivityNewsServiceImpl 
 * @since 1.0
 */
public class ActivityNewsServiceImpl implements ActivityNewsService {
	private ActivityNewsDAO activityNewsDao;

	public void setActivityNewsDao(ActivityNewsDAO activityNewsDao) {
		this.activityNewsDao = activityNewsDao;
	}

	/* (non-Javadoc)
	 * @see com.shequan.activity.service.ActivityNewsService#queryActivityNewsByUserId(int)
	 */
	public ResultDataStruct<ActivityNews> queryLastestActivityNewsByUserId(
			int userId) {
		ResultDataStruct<ActivityNews> rds=new ResultDataStruct<ActivityNews>();
		ActivityNews activityNews=activityNewsDao.selectLatestNewsByUserId(userId);
		if(activityNews!=null){
			rds.setBusiSuccess(true);
		}else{
			rds.setBusiSuccess(false);
		}
		rds.setSuccess(true);
		rds.setData(activityNews);
		return rds;
	}
}
